package com.example.zhangmeng.java_web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class HelloTemplateContrller {

    @GetMapping("/")
    public String welcome(Model model) {
        model.addAttribute("name", "Spring Boot");
        return "index"; // 对应templates/index.html
    }
}
